package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysRole;
import com.ruoyi.system.api.factory.RemoteRoleFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * 角色服务
 *
 * @author xhr
 */
@FeignClient(contextId = "remoteRoleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteRoleFallbackFactory.class)
public interface RemoteRoleService {
    /**
     * 不分页查询角色
     *
     * @param role 用户名
     * @return 结果
     */
    @PostMapping(value = "/role/listNoPaging")
    public R<List<SysRole>> listNoPaging(SysRole role);

    @GetMapping(value = "/role/{id}")
    public R<SysRole> selectId(@PathVariable("id") Long id);
}
